﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Peak.Core;

namespace Peak.Web.Controllers.Models
{
  public class UserPreferencesModel : ModelBase
  {
    public string UserName { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Email { get; set; }

    public UserPreferencesModel(): base(()=>new UserPreferencesModelValidator())
    {      
    }

    public UserPreferencesModel(User user)
      : base(() => new UserPreferencesModelValidator())
    {
      UserName = user.UserName;
      FirstName = user.FirstName;
      LastName = user.LastName;
      Email = user.Email;    
    }

    public void Update(User user)
    {
      user.UserName = UserName;
      user.FirstName = FirstName;
      user.LastName = LastName;
      user.Email = Email;        
    }
  }
}
